//
//  FMAnchorCollectionViewCell.m
//  PsychologyFM
//
//  Created by 杜建虎 on 16/1/12.
//  Copyright © 2016年 ZhangLuDu. All rights reserved.
//

#import "FMAnchorCollectionViewCell.h"

@implementation FMAnchorCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
//        CGFloat height = frame.size.height;
        CGFloat width = frame.size.width;
        
        _avatarimage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, 60, 60)];
        _avatarimage.layer.masksToBounds = YES;
        _avatarimage.layer.cornerRadius = 30;
        [self.contentView addSubview:_avatarimage];
        
        _userLabel = [[UILabel alloc] initWithFrame:CGRectMake(75, 15, width - 60, 20)];
        [self.contentView addSubview:_userLabel];
        
        _numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(75, 40, width - 60, 20)];
        _numberLabel.font = [UIFont systemFontOfSize:10];
        [self.contentView addSubview:_numberLabel];
    }
    return self;
}

- (void)setModel:(FMFindAnchorModel *)model
{
    _model = model;
   _avatarimage.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:model.user[@"avatar"]]]];
    _userLabel.text = model.title;
    _numberLabel.text = [NSString stringWithFormat:@"节目  %@",model.fmnum];
}

- (void)awakeFromNib {
    // Initialization code
}

@end
